const mongoose = require("mongoose");

const url = "mongodb://localhost:27017";
const dbName = "messagenote";

mongoose.connect(`${url}/${dbName}`).then(() => {
  console.log("db connecting");
});

const conn = mongoose.connection;
conn.on("err", (err) => {
  console.log(err);
});

module.exports = mongoose;
